<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>UpdateHouse</title>
    <link rel="stylesheet" href="/css/bootstrap.css">
    <script src="/js/bootstrap.js"></script>
    <script src="/js/jquery.js"></script>
    <script src="/js/distpicker.js"></script>
    <style>
        .top-buffer1{
            margin-top: 20px;
        }
        .top-buffer2{
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <form id="house_update" enctype="multipart/form-data" style="border: none" action="/house/updatehouse">
        <input type="text" name="houseid" th:value="${session.Onehouse.houseid}" style="display: none">
        <div class="row top-buffer1">
            <div class="col-md-4"></div>
            <div class="col-md-2">
                <div class="input-group">
                <label for="house_type" class="input-group-text">房型</label>
                <select name="housetype" id="house_type" class="form-select">
                    <option  value="一居" th:selected="${session.Onehouse.housetype == '一居'}">一居</option>
                    <option  value="二居" th:selected="${session.Onehouse.housetype == '二居'}">二居</option>
                    <option  value="三居" th:selected="${session.Onehouse.housetype == '三居'}">三居</option>
                    <option  value="四居" th:selected="${session.Onehouse.housetype == '四居'}">四居</option>
                </select>
                </div>
            </div>
            <div class="col-md-2">
                <div class="input-group">
                    <span class="input-group-text">房子价格</span>
                    <input id="house_price" class="form-control" name="houseprice" th:value="${session.Onehouse.houseprice}">
                </div>
            </div>
        </div>
        <div class="row top-buffer1">
            <div class="col-md-4"></div>
            <div class="col-md-2">
                <div class="input-group">
                    <span class="input-group-text">房子面积</span>
                    <input id="house_size" class="form-control" name="housesize" th:value="${session.Onehouse.housesize}">
                </div>
            </div>
            <div class="col-md-2">
                <div class="input-group">
                    <span class="input-group-text">房子年龄</span>
                    <input id="house_age" class="form-control" name="houseage" th:value="${session.Onehouse.houseage}">
                </div>
            </div>
        </div>
        <div class="row top-buffer1">
            <div class="col-md-4"></div>
            <label class="col-md-8">房子家具</label>
        </div>
        <div class="row top-buffer2" >
            <div class="col-md-4"></div>
            <div class="col-md-1">
                <input id="checkbox1" type="checkbox" class="form-check-input" value="床" name="housefuniture">
                <label for="checkbox1" class="form-check-label">床</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox2" class="form-check-input" value="衣柜" name="housefuniture">
                <label for="checkbox2" class="form-check-label">衣柜</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox3" class="form-check-input" value="沙发" name="housefuniture">
                <label for="checkbox3" class="form-check-label">沙发</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox4" class="form-check-input" value="电视" name="housefuniture">
                <label for="checkbox4" class="form-check-label">电视</label>
            </div>
        </div>
        <div class="row top-buffer2">
            <div class="col-md-4"></div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox5" class="form-check-input" value="冰箱" name="housefuniture">
                <label for="checkbox5" class="form-check-label">冰箱</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox6" class="form-check-input" value="洗衣机" name="housefuniture">
                <label for="checkbox6" class="form-check-label">洗衣机</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox7" class="form-check-input" value="空调" name="housefuniture">
                <label for="checkbox7" class="form-check-label">空调</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox8" class="form-check-input" value="热水器" name="housefuniture">
                <label for="checkbox8" class="form-check-label">热水器</label>
            </div>
        </div>
        <div class="row top-buffer2">
            <div class="col-md-4"></div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox9" class="form-check-input" value="宽带" name="housefuniture">
                <label for="checkbox9" class="form-check-label">宽带</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox10" class="form-check-input" value="暖气" name="housefuniture">
                <label for="checkbox10" class="form-check-label">暖气</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox11" class="form-check-input" value="燃气灶" name="housefuniture">
                <label for="checkbox11" class="form-check-label">燃气灶</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox12" class="form-check-input" value="阳台" name="housefuniture">
                <label for="checkbox12" class="form-check-label">阳台</label>
            </div>
        </div>
        <div class="row top-buffer2">
            <div class="col-md-4"></div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox13" class="form-check-input" value="卫生间" name="housefuniture">
                <label for="checkbox13" class="form-check-label">卫生间</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox14" class="form-check-input" value="智能门锁" name="housefuniture">
                <label for="checkbox14" class="form-check-label">智能门锁</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox15" class="form-check-input" value="油烟机" name="housefuniture">
                <label for="checkbox15" class="form-check-label">油烟机</label>
            </div>
            <div class="col-md-1">
                <input type="checkbox" id="checkbox16" class="form-check-input" value="可做饭" name="housefuniture">
                <label for="checkbox16" class="form-check-label">可做饭</label>
            </div>
        </div>
        <div class="row top-buffer1">
            <div class="col-md-4"></div>
            <div class="col-md-4">
                <label for="distpicker">房子位置</label> <!--地址-->
                <div id="distpicker" data-toggle="distpicker">
                    <select id="provinceName" name="province" class="form-select top-buffer2"></select>
                    <select id="cityName" name="city" class="form-select"></select>
                    <select id="districtName" name="district" class="form-select"></select>
                </div>
            </div>
        </div>
        <div class="row top-buffer1">
            <div class="col-md-4"></div>
            <div class="col-md-4">
                <label>房子名称</label>
                <input type="text" class="form-control top-buffer2" id="house_name"
                        name="housename" th:value="${session.Onehouse.housename}">
            </div>
        </div>
        <div class="row top-buffer1">
            <div class="col-md-4"></div>
            <div class="col-md-4">
                <label for="house_description">房子描述</label>
                <textarea class="form-control top-buffer2" rows="3" th:text="${session.Onehouse.housedescription}" id="house_description" name="housedescription"></textarea>
            </div>
        </div>
        <!--<div class="row top-buffer1">
            <div class="col-md-4"></div>
            <div class="col-md-4 file">
                <label for="house_image">房屋图片:</label>
                <input type="file" name="houseImage"  class="form-control top-buffer2" id="house_image" onchange="showimage(this)" multiple>
            </div>
        </div>-->
        <div class="row top-buffer1">
            <div class="col-md-5"></div>
            <div class="col-md-2">
                <button class="btn btn-outline-dark" style="width: 100%;" type="submit" id="update_house">更新</button>
            </div>
        </div>
    </form>
</body>
<script>
   /* $('#update_house').on("change" , function update_house() {
        var formData = new FormData($("#house_update")[0]);
        $.ajax({
            url: "/house/update",
            type: 'POST',
            data: formData,
            processData: false,
            contentType: false,
            success: function () {
            },
            error: function (req, status, error) {
                alert("请求处理出错!!!" + error);
            }
        });
    })*/
</script>
</html>